Data Product Assignment 3

Matthew Tung

7/25/2021

Packages Loaded

#Required Packages
library('devtools')
install_github("abresler/nbastatR")

Looking at NBA Stats in the 2020 Season.

Backend Code

library("nbastatR")
library(plotly)
players2020<-bref_players_stats(seasons = 2020, tables = c("per_game", "per_poss"))
FALSE parsed http://www.basketball-reference.com/leagues/NBA_2020_per_game.html
FALSE PerGame
fig <- plot_ly()
fig <- fig %>%
    add_trace(
        type = "scatter",
        x = players2020$pctFT, 
        y = players2020$pctFG3,
        color = players2020$groupPosition,
        size = players2020$fg3aPerGame,
        text = players2020$namePlayer,
        hovertemplate=paste('Player: %{text}', 
                            '<br>FT Pct: %{x}<br>', 
                            '3PT Pct: %{y}')
    )
fig